//  不要给我WA WA 叫
//  一定AC
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <iomanip>
#include <climits>
#define int long long 
using namespace std;
const int N = 1e5 + 10;
int a[N];
vector<int> G[N];
bool vis[N];
bool col[N];
int res = 1;

const int MOD = 1000000007;

int dfs(int rt)
{
    vis[rt] = 1;
    col[1] = 1;
    for(int i = 0; i < G[rt].size(); i++)
    {
        int son = G[rt][i];
        if(vis[son] == 1) continue;
        dfs(son);
        if(col[rt] == 1 && col[son] == 0)
        {
            col[son] = 1;
            res++;
        } 
    }
    return res % MOD;
}
void solve()
{
    int n;
    cin >> n;
    for(int i = 1; i < n; i++)
    {
        int u,v;
        cin >> u >> v;
        G[u].push_back(v);
        G[v].push_back(u);
    }
    
    cout << dfs(1) << endl; 
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int t = 1;
    while(t -- )  solve();
    return 0;
}
